package maggames.core.visual;

import java.awt.GridBagLayout;
import java.awt.Point;

import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.Dimension;
import javax.swing.BorderFactory;
import javax.swing.border.EtchedBorder;
import java.awt.Color;

public class VisualSpace extends JComponent {

	private static final long serialVersionUID = 1L;
	private VisualPiece visualPiece = null;
	private Point boardLocation;
	
	
	public VisualPiece getVisualPiece() {
		return visualPiece;
	}

	public void setVisualPiece(VisualPiece piece) {
		this.visualPiece = piece;
	}

	/**
	 * This is the default constructor
	 */
	public VisualSpace() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(32, 32);
		this.setLayout(new GridBagLayout());
		this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
		this.setPreferredSize(new Dimension(32, 32));
		this.setBackground(Color.green);
	}
	
	public Point getCenter() {
		return new Point(this.getX()+this.getWidth()/2,this.getY()+this.getHeight()/2);
	}

	public Point getBoardLocation() {
		return boardLocation;
	}

	public void setBoardLocation(Point boardLocation) {
		this.boardLocation = boardLocation;
	}

}
